package com.njtoyo.taxi.admin.rest.export;

import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.Data;

import java.util.Date;

@Data
public class RideMarkingListData {
    @ExcelProperty(value = "评价id")
    private Long id;

    @ExcelProperty(value = "行程id")
    private Long rideId;

    @ExcelProperty(value = "行程编号")
    private String number;

    @ExcelProperty(value = "评价订单类型")
    private String category;

    @ExcelProperty(value = "评价使用平台")
    private String platform;

    @ExcelProperty(value = "司机id")
    private Long driverId;

    @ExcelProperty(value = "司机姓名")
    private String driverName;

    @ExcelProperty(value = "手机号码")
    private String driverMobileNumber;

    @ExcelProperty(value = "乘客id")
    private Long userId;

    @ExcelProperty(value = "乘客姓名")
    private String userName;

    @ExcelProperty(value = "乘客手机号码")
    private String userMobileNumber;

    @ExcelProperty(value = "评分")
    private Long score;

    @ExcelProperty(value = "评价内容")
    private String comment;

    @ExcelProperty(value = "评价标签")
    private String title;

    @ExcelProperty(value = "创建时间")
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    private Date createdAt;

    public void setCategory(String category) {
        switch (category) {
            case "0":
                this.category = "实时单";
                break;
            case "1":
                this.category = "预约单";
                break;
            case "2":
                this.category = "指定单";
                break;
            default:
                this.category = category;
        }
    }

    public void setPlatform(String platform) {
        switch (platform) {
            case "0":
                this.platform = "微信小程序";
                break;
            case "1":
                this.platform = "APP";
                break;
            case "2":
                this.platform = "h5网页";
                break;
            case "3":
                this.platform = "全澄通";
                break;
            case "4":
                this.platform = "h5本地生活";
                break;
            default:
                this.platform = category;
        }
    }
}
